package com.wjk.kylin.mall.product.kafka.datasync;


import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * @description:
 * @author: wangjinkui
 * @create: 2022-07-18
 **/
public class ProductDataSyncExecutorFactory {
    private static final ConcurrentMap<String, ProductDataSyncExecutor> FACTORY = new ConcurrentHashMap<>();

    /**
     * 获取
     *
     * @param tableName
     * @return
     */
    public static ProductDataSyncExecutor getExecutor(String tableName) {
        return FACTORY.get(tableName);
    }


    /**
     * 注册
     *
     * @param tableName
     * @param executor
     */
    public static void register(String tableName, ProductDataSyncExecutor executor) {
        FACTORY.put(tableName, executor);
    }

}
